From: Keir Fraser Date: Thu, 2 Apr 2009 13:17:19 +0000 (+0100) Subject: Move logic for avoiding limited idle quantum into credit scheduler. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13989^2~8 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=c806877d1b3992a9a75e4aa7604911d048891410;p=xen.git Move logic for avoiding limited idle quantum into credit scheduler. Signed-off-by: Keir Fraser --- diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index c554c8b8b9..67ff04647f 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -1146,7 +1146,8 @@ csched_schedule(s_time_t now) /* * Return task to run next... */ - ret.time = MILLISECS(CSCHED_MSECS_PER_TSLICE); + ret.time = (is_idle_vcpu(snext->vcpu) ? + -1 : MILLISECS(CSCHED_MSECS_PER_TSLICE)); ret.task = snext->vcpu; CSCHED_VCPU_CHECK(ret.task); diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 23807ea330..fb2464f11d 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -798,7 +798,6 @@ static void schedule(void) s_time_t now = NOW(); struct schedule_data *sd; struct task_slice next_slice; - s32 r_time; /* time for new dom to run */ ASSERT(!in_irq()); ASSERT(this_cpu(mc_state).flags == 0); @@ -814,13 +813,12 @@ static void schedule(void) /* get policy-specific decision on scheduling... */ next_slice = ops.do_schedule(now); - r_time = next_slice.time; next = next_slice.task; sd->curr = next; - if ( !is_idle_vcpu(next) ) - set_timer(&sd->s_timer, now + r_time); + if ( next_slice.time >= 0 ) /* -ve means no limit */ + set_timer(&sd->s_timer, now + next_slice.time); if ( unlikely(prev == next) ) { @@ -836,7 +834,7 @@ static void schedule(void) next->domain->domain_id, (next->runstate.state == RUNSTATE_runnable) ? (now - next->runstate.state_entry_time) : 0, - r_time); + next_slice.time); ASSERT(prev->runstate.state == RUNSTATE_running); vcpu_runstate_change(